<!-- index.html -->

{% extends "base.html" %}

{% block content %}
<h2>药品库存信息</h2>

<table class="table table-bordered">
    <thead>
        <tr>
            <th>药品ID</th>
            <th>药品名称</th>
            <th>总库存量</th>
        </tr>
    </thead>
    <tbody>
        {% for drug in drugs %}
        <tr>
            <td>{{ drug[0] }}</td>
            <td>{{ drug[1] }}</td>
            <td>{{ drug[2] }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% if low_stock_items %}
<div class="alert alert-danger" role="alert">
    <h4>警告：以下药品库存低于警戒线</h4>
    <ul>
        {% for item in low_stock_items %}
        <li>药品名称: {{ item[0] }}, 剩余库存: {{ item[1] }}</li>
        {% endfor %}
    </ul>
</div>
{% endif %}

{% endblock %}
